#ifndef PACKET_H_

#define PACKET_H_

#include "common.h"
#include "object.h"

class Packet : public Object{
	public:
		enum PACK_TYPE{
			DATA_PACKET,
			CHORD_PACKET
		};

		Packet( node_id_t s_id, uint16_t len, PACK_TYPE type )
		: src_id_(s_id)
		, pack_len_(len)
		, pack_type_(type)
		, hops_(0)
		{}

		virtual ~Packet(){}

		node_id_t getSrcID() const { return src_id_; }
		uint16_t    getPackLen() const { return pack_len_; }
		PACK_TYPE   getPackType() const { return pack_type_; }

		uint16_t    hops() const { return hops_; }
		void        incHops() { hops_++; }

		static const uint32_t packet_header_len = 8;

	protected:
		node_id_t src_id_; 
		uint16_t  pack_len_;
		PACK_TYPE pack_type_;
		uint16_t  hops_;

};

#endif /* PACKET_H_ */

